<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="sealte.hvpms.pojo.UserCreate,sealte.hvpms.dao.impl.UserDAOImpl"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>仓鼠网上投票系统HVPMS</title>
<link href="css/modifyPassword.jsp.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
function validateToSubmit(){
	var resetForm = $('#resetForm');
	var email = $('#e_mail').val();
	var reg = /^\s+|\s+$/g;
	var reg_email = /^(\w)+@(\w)+\.(\w)+/;
	email = email.replace(reg,"");
	if(email!=""){
		if(reg_email.test(email)){
			resetForm.submit();
		}else{
			alert("邮箱格式不正确");
		}
	}else{
		alert("新邮箱不能为空");
	}
}
</script>
</head>
<body>
<%
		UserCreate uc = (UserCreate) session.getAttribute("UserCreate");
		if (uc != null) {
			UserDAOImpl ub = new UserDAOImpl();
			String email = ub.getEmailByID(uc.getId());
%>
<div id="num2">
	<h2><img src="images/user_home.png">&nbsp;个人信息--重置资料</h2>
</div>

<div id="num1">
<form id="resetForm" action="UCResetInfo" method="POST">
<table>
	<tr>
	<th>旧邮箱：</th>
	<td><input type="text" value="<%=email %>"/></td>
	</tr>
	
	<tr>
	<th>新邮箱：</th>
	<td>
	<input type="text" name="email" id="e_mail"/>
	</td>
	</tr>
	
	<tr>
	<td></td>
	<td align="left">
	<input type="button" value="修改" onclick="validateToSubmit()"/>
	</td>
	</tr>
</table>
<input type="hidden" value="<%=uc.getId() %>" name="id"/>
</form>
</div>
<span>
	<%
		String message_ri = (String)request.getAttribute("message_resetInfo");
		if(message_ri!=null&&!message_ri.equals("")){
			out.println("["+message_ri+"]");
		}
	 %>
</span>
<%
		} else {
			out.println("谢绝跨路径访问！");
		}
%>
</body>
</html>